package com.example.demo.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;


/**
 * Created by liujiahao on 2018/11/29.
 */
@Aspect
@Component
public class Aspects {
    @Pointcut("execution(* com.example.demo.aspect.AspectTest.tt(..))")
    public void TestCut(){};
    @Pointcut("@annotation(com.example.demo.aspect.Anno)")
    public void TestCut2(){};
    @Before("TestCut2()")
        public void TestBefore(JoinPoint point){
        Object[] o=point.getArgs();
        for (Object o1 : o) {
            if(o1 instanceof InputArgs){
                InputArgs in=(InputArgs)o1;
                in.setMessage("dsadsad");
            }
        }
    }

}
